<?php

/**
 * This is the model class for table "hargaecerankctanahhijaukedelai".
 *
 * The followings are the available columns in table 'hargaecerankctanahhijaukedelai':
 * @property integer $hekhk_id
 * @property integer $hekhk_bulan
 * @property integer $hekhk_kcnonkupas
 * @property integer $hekhk_hijau
 * @property integer $hekhk_kedelai
 * @property integer $hekhk_tahun
 */
class Hargaecerankctanahhijaukedelai extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Hargaecerankctanahhijaukedelai the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'hargaecerankctanahhijaukedelai';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('hekhk_bulan, hekhk_kcnonkupas, hekhk_hijau, hekhk_kedelai, hekhk_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('hekhk_id, hekhk_bulan, hekhk_kcnonkupas, hekhk_hijau, hekhk_kedelai, hekhk_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'hekhk_id' => 'Hekhk',
			'hekhk_bulan' => 'Hekhk Bulan',
			'hekhk_kcnonkupas' => 'Hekhk Kcnonkupas',
			'hekhk_hijau' => 'Hekhk Hijau',
			'hekhk_kedelai' => 'Hekhk Kedelai',
			'hekhk_tahun' => 'Hekhk Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('hekhk_id',$this->hekhk_id);
		$criteria->compare('hekhk_bulan',$this->hekhk_bulan);
		$criteria->compare('hekhk_kcnonkupas',$this->hekhk_kcnonkupas);
		$criteria->compare('hekhk_hijau',$this->hekhk_hijau);
		$criteria->compare('hekhk_kedelai',$this->hekhk_kedelai);
		$criteria->compare('hekhk_tahun',$this->hekhk_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}